<%-- 
    Document   : Publish known issues
    Created on : Feb 27, 2013, 4:50:12 PM
    Author     : mona.chandrapal
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Publish known issues</title>

<%@include file="header.jsp"%>


<script type="text/javascript" charset="utf-8">

	var user = "";
	function AddPageInit(username) {
		user = username;
		// alert("User:"+username);
	
	}

	$(document).ready(function() {

		$("#btnpublish").live(

		'click', function() {

			var ids = $("#publishtable").getGridParam('selarrrow');

			//alert("TEST: " + ids);

			$.ajax({
				type : "post",
				url : "../publishIssue",
				datatype : "json",
				data : "ids=" + ids + "&user="+user,
				success : function(data) {
					//alert("Articles published");
					$('#issuespublished').modal("show");
					
					

					return false;
				},
				error : function(jqXHR, textStatus) {
					alert("Request failed: " + textStatus);
				}
			});
		});
		
		$("#ok").live('click', function() {

			$('#issuespublished').modal('hide');

			$("#publishtable").jqGrid('setGridParam', {
				url : '../GetIssueToPublish',
				page : 1
			}).trigger("reloadGrid");
		});
		

	});
</script>

</head>
<body onload="AddPageInit('<%=session.getAttribute("user")%>')">

	<%@include file="toppanel.jsp"%>

	<div class="span12" align="center">
		<b>Publish Known Issues &nbsp;&nbsp; </b> <input type="submit"
			id="btnpublish" value="Publish" name="btnpublish" class="btn" />

	</div>

	<br />
	<br />
	<br />

	<div class="span12" style="margin-left: 100px;">

		<table id="publishtable" style="text-indent: 5px"></table>
		<div id="pager"></div>
	</div>



	<div id="issuespublished" class="modal fade"
		style="display: none;">
		<div class="modal-header">
			<h4>Published</h4>
		</div>
		<div class="modal-body">
			<div class="alert alert-success">Issues Published.</div>

		</div>
		<div class="modal-footer">
			<a href="#" class="btn confirm_delete_the_item no_return" id="ok">OK</a>
		</div>
	</div>



</body>
</html>
